@include('admin.header')
<style>
form{

	
}
label{
	line-height:40px;
}
label span{
	display: inline-block;
	width: 150px;
	text-align: right;
}
input[type="submit"]{
	position: absolute;
	right: 20px;
	bottom: 20px;
	margin-left: 20px;
	display: inline-block;
	text-align: right;
}




</style>
</head>
<body>
	<div class="wrap js-check-wrap">

		<form  method="post" class="js-ajax-tree js-category-add">
			<div>
				<label>
				<span>转出方类型：</span>
				 <select name="from_ownertype">
					<option value="">None</option>	
					<option value="1" @if($id>0){@if($data->from_ownertype == 1){echo selected="selected";} @endif}@endif >用户账户</option>	
					<option value="2" @if($id>0){@if($data->from_ownertype == 2){echo selected="selected";} @endif}@endif>商家账户</option>	
					<option value="3" @if($id>0){@if($data->from_ownertype == 3){echo selected="selected";} @endif}@endif>企业账户</option>	
					<option value="99" @if($id>0){@if($data->from_ownertype == 99){echo selected="selected";} @endif}@endif>系统账户</option>	
				 </select>
				</label>
				
				<label>
				<span>转出方钱包类型：</span>
				 <select name="from_pursetype">
					<option value="0" @if($id>0){@if($data->from_pursetype == 0){echo selected="selected";} @endif}@endif>None</option>	
					<option value="1" @if($id>0){@if($data->from_pursetype == 1){echo selected="selected";} @endif}@endif>收益账户</option>	
					<option value="2" @if($id>0){@if($data->from_pursetype == 2){echo selected="selected";} @endif}@endif>现金账户</option>	
					<option value="3" @if($id>0){@if($data->from_pursetype == 3){echo selected="selected";} @endif}@endif>积分账户</option>	
					<option value="4" @if($id>0){@if($data->from_pursetype == 4){echo selected="selected";} @endif}@endif>o2o收益账户</option>	
					<option value="96" @if($id>0){@if($data->from_pursetype == 96){echo selected="selected";} @endif}@endif>过账账户</option>	
					<option value="97" @if($id>0){@if($data->from_pursetype == 97){echo selected="selected";} @endif}@endif>授信账户</option>	
					<option value="98" @if($id>0){@if($data->from_pursetype == 98){echo selected="selected";} @endif}@endif>中央银行账户</option>	
					<option value="99" @if($id>0){@if($data->from_pursetype == 99){echo selected="selected";} @endif}@endif>系统收益账户</option>	
				 </select>
				</label>

				<label>
				<span>接收方类型：</span>
				 <select name="to_ownertype">
					<option value="0" @if($id>0){@if($data->to_ownertype == 0){echo selected="selected";} @endif}@endif>None</option>	
					<option value="1" @if($id>0){@if($data->to_ownertype == 1){echo selected="selected";} @endif}@endif>用户账户</option>	
					<option value="2" @if($id>0){@if($data->to_ownertype == 2){echo selected="selected";} @endif}@endif>商家账户</option>	
					<option value="3" @if($id>0){@if($data->to_ownertype == 3){echo selected="selected";} @endif}@endif>企业账户</option>	
					<option value="99" @if($id>0){@if($data->to_ownertype == 99){echo selected="selected";} @endif}@endif>系统账户</option>	
				 </select>
				</label>

				<label>
				<span>接收方钱包类型：</span>
				 <select name="to_pursetype">
					<option value="0" @if($id>0){@if($data->to_pursetype == 0){echo selected="selected";} @endif}@endif>None</option>	
					<option value="1" @if($id>0){@if($data->to_pursetype == 1){echo selected="selected";} @endif}@endif>收益账户</option>	
					<option value="2" @if($id>0){@if($data->to_pursetype == 2){echo selected="selected";} @endif}@endif>现金账户</option>	
					<option value="3" @if($id>0){@if($data->to_pursetype == 3){echo selected="selected";} @endif}@endif>积分账户</option>	
					<option value="4" @if($id>0){@if($data->to_pursetype == 4){echo selected="selected";} @endif}@endif>o2o收益账户</option>	
					<option value="96" @if($id>0){@if($data->to_pursetype == 96){echo selected="selected";} @endif}@endif>过账账户</option>	
					<option value="97" @if($id>0){@if($data->to_pursetype == 97){echo selected="selected";} @endif}@endif>授信账户</option>	
					<option value="98" @if($id>0){@if($data->to_pursetype == 98){echo selected="selected";} @endif}@endif>中央银行账户</option>	
					<option value="99" @if($id>0){@if($data->to_pursetype == 99){echo selected="selected";} @endif}@endif>系统收益账户</option>	
				 </select>
				</label>

				<label>
				<span>要求OwnerId相同：</span>
				 <select name="same_ownerid">
					<option value="1" @if($id>0){@if($data->same_ownerid == 1){echo selected="selected";} @endif}@endif >是</option>	
					<option value="0" @if($id>0){@if($data->same_ownerid == 0){echo selected="selected";} @endif}@endif >否</option>	
				 </select>
				</label>

				<label>
				<span>要求SubId相同：</span>
				 <select name="same_subid">
					<option value="1"  @if($id>0){@if($data->same_subid == 1){echo selected="selected";} @endif}@endif >是</option>
					<option value="0"  @if($id>0){@if($data->same_subid == 0){echo selected="selected";} @endif}@endif >否</option>	
				 </select>
				</label>

				<label>
				<span>状态：</span>
				 <select name="state">
					<option value="1" @if($id>0){@if($data->state == 1){echo selected="selected";} @endif}@endif >允许转账</option>	
					<option value="0" @if($id>0){@if($data->state == 0){echo selected="selected";} @endif}@endif >未启用</option>	
					<option value="2" @if($id>0){@if($data->state == 2){echo selected="selected";} @endif}@endif >禁止启用</option>	
					<option value="3" @if($id>0){@if($data->state == 3){echo selected="selected";} @endif}@endif >宽松允许</option>	
				 </select>
				</label>
			   <label>
				<span>备注：</span>
				<input type="text" style="width: 200px;height: 35px;" name="remark" value="{{$data->remark or ''}}"/>
				</label>
				<input type="hidden" name="ruleid" value="{{$data->ruleid or ''}}"/>
				<input type="submit" class="btn btn-primary" value="提交" />
				
			</div>
		</form>
	</div>
	<script type="text/javascript" src="/static/js/common.js"></script>
	<script type="text/javascript" src="/static/js/validate/validate.js"></script>
	<script type="text/javascript" src="/static/js/layer/layer.js"></script>
	<script type="text/javascript">
			$(function() {
			$(".js-category-add").validate({
				rules: {
					from_ownertype: {
						required: true
					}
				},
				messages: {
					from_ownertype: {
						required: "请选择转出方类型"
					}
				},
				submitHandler: function () {
					$.post("/basiconfig/{{$action}}",$('.js-category-add').serialize(), function (msg) {
						if (msg.status == 1) {
							layer.confirm(msg.info, {
								btn: ['确定']
							}, function(){
								@if($action == 'add_rule')
									window.parent.location.reload();
									var index = parent.layer.getFrameIndex(window.name);
									parent.layer.close(index);
								@endif
							});
						} else {
							showMsg(msg.info);
						}
					}, 'json');
					return false;
				}
			});
		});
		/**
		 * layer提示
		 */
		function showMsg(msg){
			layer.alert(msg, {
				title: '提示',
				icon: 2,
			});
		}
	</script>
</body>
</html>